//
//  ViewController.m
//  LoginTest
//
//  Created by kievkao on 5/17/14.
//  Copyright (c) 2014 kievkao. All rights reserved.
//

#import "ViewController.h"
#import "KKSocialManager.h"
#import "KKGenericSocialManager.h"
#import "VKSdk.h"
#import "WebFormHandler.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
//	[VKSdk initializeWithDelegate:self andAppId:@"4367180"];
    [[WebFormHandler sharedInstance] setWebFormType:0];
    KKGenericSocialManager *manager = [[[KKSocialManager alloc] init] getSocialNetManagerByType:KKFacebookType];
    [manager setPermissions:@[@"public_profile", @"email"]];
    //[manager setPermissions:@[@"VK_PER_STATUS"]];
    
    [manager loginWithCompletion:^(NSError *error, NSDictionary *userData) {
        NSLog(@"Login finished");
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)vk:(id)sender {

    [VKSdk authorize:@[VK_PER_FRIENDS, VK_PER_WALL, VK_PER_AUDIO, VK_PER_PHOTOS, VK_PER_NOHTTPS] revokeAccess:YES forceOAuth:YES];
}

- (void)vkSdkReceivedNewToken:(VKAccessToken *)newToken
{
    NSLog(@"d");
}

- (void)vkSdkUserDeniedAccess:(VKError *)authorizationError
{
    NSLog(@"d");
}

- (void)vkSdkAcceptedUserToken:(VKAccessToken *)token
{
    NSLog(@"d");
}

- (void)vkSdkNeedCaptchaEnter:(VKError *)captchaError
{
    NSLog(@"d");
}



- (void)vkSdkRenewedToken:(VKAccessToken *)newToken
{
    NSLog(@"d");
}

- (void)vkSdkShouldPresentViewController:(UIViewController *)controller
{
    NSLog(@"d");
}

- (void)vkSdkTokenHasExpired:(VKAccessToken *)expiredToken
{
    NSLog(@"d");
}


@end
